package com.xiongwei.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @author XiongWei
 * @date 2024/2/20
 */
public class Client {

    public static void main(String[] args) {
        List<College> collegeList = new ArrayList<>();

        collegeList.add(new ComputerCollege());
        collegeList.add(new InfoCollege());

        for (College college : collegeList) {
            System.out.println("--------" + college.getName() + "---------------");
            Iterator iterator = college.createIterator();
            while (iterator.hasNext()) {
                System.out.println(iterator.next());
            }
        }
    }
}
